package com.demo.supplier.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 供应商实体类
 * 
 * @author demo
 */
@Data
@TableName("T_SUPPLIER_INFO")
@ApiModel("供应商实体")
public class SupplierInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("供应商ID")
    @TableId(value = "ID", type = IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty("供应商编码")
    @TableField("SUPPLIER_CODE")
    private String supplierCode;

    @ApiModelProperty("供应商名称")
    @TableField("SUPPLIER_NAME")
    private String supplierName;

    @ApiModelProperty("联系人")
    @TableField("CONTACT_PERSON")
    private String contactPerson;

    @ApiModelProperty("联系电话")
    @TableField("CONTACT_PHONE")
    private String contactPhone;

    @ApiModelProperty("联系邮箱")
    @TableField("CONTACT_EMAIL")
    private String contactEmail;

    @ApiModelProperty("地址")
    @TableField("ADDRESS")
    private String address;

    @ApiModelProperty("营业执照号")
    @TableField("BUSINESS_LICENSE")
    private String businessLicense;

    @ApiModelProperty("信用等级")
    @TableField("CREDIT_RATING")
    private String creditRating;

    @ApiModelProperty("状态：1=启用，0=禁用")
    @TableField("STATUS")
    private Integer status;

    @ApiModelProperty("Logo图片URL")
    @TableField("LOGO_URL")
    private String logoUrl;

    @ApiModelProperty("描述")
    @TableField("DESCRIPTION")
    private String description;

    @ApiModelProperty("Logo文件ID")
    @TableField("LOGO_FILE_ID")
    private Long logoFileId;

    @ApiModelProperty("营业执照文件ID")
    @TableField("LICENSE_FILE_ID")
    private Long licenseFileId;

    @ApiModelProperty("资质证书文件ID")
    @TableField("CERTIFICATE_FILE_ID")
    private Long certificateFileId;

    // 非数据库字段，用于返回文件信息
    @TableField(exist = false)
    private FileInfo logoFile;

    @TableField(exist = false)
    private FileInfo licenseFile;

    @TableField(exist = false)
    private FileInfo certificateFile;

    @ApiModelProperty("创建时间")
    @TableField(value = "CREATE_TIME", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    @TableField(value = "UPDATE_TIME", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @ApiModelProperty("创建人")
    @TableField(value = "CREATE_BY", fill = FieldFill.INSERT)
    private Long createBy;

    @ApiModelProperty("更新人")
    @TableField(value = "UPDATE_BY", fill = FieldFill.INSERT_UPDATE)
    private Long updateBy;

    @ApiModelProperty("删除标记：1=已删除，0=未删除")
    @TableField("DELETED")
    @TableLogic
    private Integer deleted;
}